package cn.lhl.dao.impl;

import cn.lhl.beans.Stuck;
import cn.lhl.dao.IStuckDao;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2017/4/6/006.
 */
@Repository
public class StuckDaoImpl implements IStuckDao{
    @Resource
    private SessionFactory sessionFactory;
    @Transactional
    public void addStuck(Stuck stuck) {
        Session session=sessionFactory.getCurrentSession();
        System.out.println("asdsa");
        session.save(stuck);
    }

    public SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }
}
